HAL DMA migration: List of applicable concepts ¶
This section provides information about the HAL DMA applicable architecture concepts.
Concepts for DMA ¶
|
Concept |
Description |
|---|---|
|
The initialization has been split into separate init and config functions:
|
|
|
Removal and conversion of init structure to configuration structure |
The init structure
|
|
The handle structure has been renamed to
|
|
|
Unitairy init structures have been renamed to use the
For example :
|
|
|
New APIs are available to get and set DMA features. |
|
|
Two functions to set and get user data are available:
|
|
|
Individual callback registration APIs replace global register and unregister functions |
The callback registration is handled by specific functions for each DMA event. These functions are used to register callback functions for different DMA events. |
|
HAL DMA APIs now rely on LL APIs rather than performing direct register access. |
|
|
Define statements and enumerations redirected to LL equivalents |
HAL DMA define statements and enumerations are based on LL define statements. |
|
All hardware macros have been removed from the HAL DMA driver, and equivalent services are ensured through the LL APIs. |
|
|
The DMA state machine is reworked to ensure transitions of the peripheral functional states. |
|
|
The HAL DMA functions were updated to return:
|
|
|
The HAL error handling mechanisms have been redesigned to improve the detection, reporting, and handling of errors. This provides more detailed and consistent error information. |
|
|
New APIs for filtering optional asynchronous process interrupts |
New HAL DMA transfer APIs with interrupt filtering capabilities have been introduced, such as
|
|
All TypeDef parts of the HAL DMA driver have been removed and replaced by
|
|
|
Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable. |
|
|
The parameters and state are checked using
|
|
|
Merge HAL extension files with common ones and remove the EX prefix from APIs. |
Only one HAL DMA header file remains and all macros, define statements, and functions from
|
|
Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels. |
Finite parameters (including DMA instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety. |
|
Move Queuing/Linked List Logical Services into a Standalone HAL Queuing Driver |
This concerns the HAL Q driver (stm32tnxx_hal_q.h): queue creation is now supported directly by this dedicated driver, rather than being implemented within the HAL DMA layer. |
|
Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions). |
All HAL DMA enums and struct start with
|
Other HAL DMA changes ¶
|
Concept |
Consideration |
|---|---|
|
Unify initialization and configuration sequence for legacy and linked-list transfers. |
The same user sequence need to be adopted to perform legacy and linked-list configuration. Reduces footprint and complexity within PPP module.
|
|
DMA linked-list features are available under
|
In order to benefit from the HAL DMA linked-list feature, users need to set the
|
|
A new sequence is needed to create a linked-list using the HAL Q and associate it to the DMA instance using the dedicated APIs. |
Introduce a new HAL Q driver that enables linked-list creation and reworks the association between HAL DMA and linked lists. |
|
Rework FIFO API. |
Retain the
Introduce the
|
|
Rework
|
Simplify the configuration of block and burst offset values, as well as jump direction parameters.. Users now specify the size and increment direction explicitly instead of providing signed offset values. |
|
Add weak callbacks (Default) to avoid checking on callbacks pointer after each call within the
|
Weaks callbacks are affected to handle callbacks within
Unlike other HAL PPP modules that support callback registration, HAL DMA callbacks are not controlled by the
|
|
Rework DMA transfer functions parameter size. |
|
|
Rework the DMAMUX synchronization API. |
|
|
Rework DMAMUX request generator API. |
|